package ex.datastream.functions.function;

import org.apache.flink.streaming.api.functions.source.SourceFunction;

import java.util.Arrays;
import java.util.List;

/**
 * 自定义多并行度Source
 */
public  class SourceFunc implements SourceFunction<String> {
    @Override
    public void run(SourceContext sourceContext) throws Exception {
        List<String> strs = Arrays.asList("a", "b", "c");
        for (String s : strs) {
            sourceContext.collect(s);
        }
    }
    @Override
    public void cancel() {
    }
}